package org.ccay.core.util;

/**
 * Http 工具类
 */
public final class HttpUtil {

	private HttpUtil(){		
	}
	
	/**
	 * 正常响应码结束
	 */
	public  static final int NORMAL_END=299;
	
	/**
	 * 未授权
	 */
	public  static final int NO_PERMISSION=401;
	/**
	 * 未登录
	 */
	public  static final int NOT_LOGIN=403;
	/**
	 * 服务器错误
	 */
	public  static final int SERVER_ERROR=500;
	
	/**
	 * 资源未找到
	 */
	public  static final int NOT_FOUND = 404;
	/**
	 * 正常
	 */
	public  static final int OK = 200;
	
	/**
	 * 维护中
	 */
	public  static final int MAINTENANCE = 423;
	 

	/** 
	 * 检查状态码是否正常的响应码
	 * @param statusCode
	 * @return
	 */
	public static boolean isNormalResponse(int statusCode){
		return  statusCode <= NORMAL_END && statusCode >= OK ;
	}
}
